home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Ahoy 1988 December
/
Ahoy_Magazine_88-12_1988_Double_L.d64
/
Rapid Random II
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-10-26
|
419b
|
13 lines
0 poke53280,1:print"[147]"tab(12)"rapid randomizer":print"please wait..."
1 rem ==================================
2 rem commodares problem #55-2 :
3 rem rapid randomizer
4 rem solution by
5 rem doug ropp
6 rem ==================================
10 n=100: dim x(n): for i=1 to n: x(i)=i: next
20 t0=ti
30 x(0)=x(n):fori=0ton-1:n=rnd(n)*i:j=x(i):x(i)=x(n):x(n)=j:next:n=i:x(n)=x(0)
40 print ti-t0"jiffies"
50 for i=1 to n:print x(i);:next